home *** CD-ROM | disk | FTP | other *** search
/ HPAVC / HPAVC CD-ROM.iso / pc / RGASM.RAR / ASMCODE.EXE / CHAPT8 / PG0805.ASM < prev    next >
Encoding:
Assembly Source File  |  1994-08-28  |  6.4 KB  |  133 lines

  1. ;***********************************************************************
  2. ;
  3. ;  Program PG0806 ( Chapter 8 ) 
  4. ;
  5. ;  Outpt windows of certain color on the screen
  6. ;
  7. ;  An example of blinking-intensity controlling
  8. ;
  9. ;  Author: A.I.Sopin     VSU,  Voronezh,  1992
  10. ;
  11. ;***********************************************************************
  12.  
  13. .model small
  14. .stack
  15. EXTRN   BLINK : FAR, WIND : FAR
  16. .data
  17. WIND1   DB      '┌───────────────────────┐'  ; coordinates: (row, column)
  18.     DB      '│       WINDOW 1        │'  ; start (3,4)
  19.     DB      '│                       │'  ; end  (12,28)
  20.     DB      '│   An Ordinary Mode    │'
  21.     DB      '│  Background = Brown   │'
  22.     DB      '│   Attribute = 60h     │'
  23.     DB      '│                       │'
  24.     DB      '│                       │'
  25.     DB      '│                       │'
  26.     DB      '└───────────────────────┘'
  27. ;
  28. WIND2   DB      '┌───────────────────────┐'  ; coordinates: (row,column)
  29.     DB      '│       WINDOW 2        │'  ; start (3,40)
  30.     DB      '│                       │'  ; end  (12,64)
  31.     DB      '│   An Ordinary Mode    │'
  32.     DB      '│  Bacground requested  │'
  33.     DB      '│    Bright Yellow      │'
  34.     DB      '│   Attribute = 0Eh     │'
  35.     DB      '│    Press Any Key      │'
  36.     DB      '│                       │'
  37.     DB      '└───────────────────────┘'
  38. ;
  39. WIND3   DB      '┌───────────────────────┐'  ; coordinates (row,column)
  40.     DB      '│       WINDOW 3        │'  ; start (3,40)
  41.     DB      '│                       │'  ; end  (12,64)
  42.     DB      '│   An Intensive Mode   │'
  43.     DB      '│   On  Bright Yellow   │'
  44.     DB      '│    Attribute = 0Eh    │'
  45.     DB      '│                       │'
  46.     DB      '│                       │'
  47.     DB      '│                       │'
  48.     DB      '└───────────────────────┘'
  49. TEXT    DB      ' An example of blinking-intensinty controlling.'
  50.     DB      ' Press any key...$'
  51. ;----------------------------------------------------------
  52. .code
  53. .Startup
  54.     mov     ah,0Fh                  ; function 0Fh - Get Video Mode
  55.     int     10h                     ; BIOS video service
  56.     mov     ah,08h                  ; Read Character/Attribute
  57.     int     10h                     ; BIOS video service call
  58.     mov     bh,ah                   ; attribute for clearing window 
  59.     mov     ah,06h                  ; function 06h - scroll window
  60.     mov     al,0                    ; scroll full screen
  61.     mov     cx,0                    ; left upper corner - 0,0
  62.     mov     dx,184Fh                ; right upper corner = 24,79
  63.     int     10h                     ; BIOS video service
  64.     mov     ah,2                    ; function 02h - set cursor
  65.     xor     dx,dx                   ; initial position 0,0
  66.     mov     bh,0                    ; video page 0
  67.     int     10h                     ; BIOS video service     
  68.     lea     dx,TEXT                 ; text start address
  69.     mov     ah,9                    ; fonction 09h - output text string
  70.     int     21h                     ; DOS service call
  71.     mov     ah,0                    ; function 0 - get key
  72.     int     16h                     ; BIOS keyboard service
  73.     mov     ah,2                    ; function 02h - set cursor
  74.     mov     dx,1950h                ; position for cursor - 25,80
  75.     mov     bh,0                    ; video page 0
  76.     int     10h                     ; BIOS video service
  77. ;-------------------------------------------------------------------
  78. ;  Output Window 1 onto the screen
  79.     mov     dh,3                    ;  row for window left upper corner
  80.     mov     dl,4                    ;  column for window left upper corner
  81.     mov     ch,12                   ;  row for window right down corner
  82.     mov     cl,28                   ;  column for window right upper
  83.     xor     bh,bh                   ;  video page 0
  84.     lea     si,WIND1                ;  DS:SI - address of window text
  85.     mov     ah,60h                  ;  attribute (black on brown)
  86.     Call    WIND                    ;  display window 1
  87. ;  Output Window 2 onto the screen
  88.     mov     dh,3                    ;  row for window left upper corner
  89.     mov     dl,40                   ;  column for window left upper corner
  90.     mov     ch,12                   ;  row for window right down corner
  91.     mov     cl,64                   ;  column for window right upper
  92.     xor     bh,bh                   ;  video page 0
  93.     lea     si,WIND2                ;  DS:SI - address of window text
  94.     mov     ah,0E0h                 ;  attribute (black on yellow)
  95.     Call    WIND                    ;  display window 2
  96. ;  After pressing a key the blinking/intensity mode will be changed
  97.     mov     ah,0                    ; function 0 - get key
  98.     int     16h                     ; BIOS keyboard service
  99. ;  Change the meaning of blinking/intensity bit
  100.     xor     al,al                   ;  switch blinking OFF
  101.     Call    BLINK                   ;  change blinking/intensity mode
  102. ;  Output Window 1 onto the screen
  103.     mov     dh,3                    ;  row for window left upper corner
  104.     mov     dl,4                    ;  column for window left upper corner
  105.     mov     ch,12                   ;  row for window right down corner
  106.     mov     cl,28                   ;  column for window right upper
  107.     xor     bh,bh                   ;  video page 0
  108.     lea     si,WIND1                ;  DS:SI - address of window text
  109.     mov     ah,60h                  ;  attribute (black on brown)
  110.     Call    WIND                    ;  display window 1
  111. ;  Output Window 2 onto the screen
  112.     mov     dh,3                    ;  row for window left upper corner
  113.     mov     dl,40                   ;  column for window left upper corner
  114.     mov     ch,12                   ;  row for window right down corner
  115.     mov     cl,64                   ;  column for window right upper
  116.     xor     bh,bh                   ;  video page 0
  117.     lea     si,WIND3                ;  DS:SI - address of window text
  118.     mov     ah,0E0h                 ;  attribute (black on yellow)
  119.     Call    WIND                    ;  display window 2
  120. ;-------------------------------------------------------------------
  121. ;  Finish the program and return to MS-DOS
  122. Exit:   mov     ah,0                    ; function 0 - get key
  123.     int     16h                     ; BIOS keyboard service
  124.     mov     al,1                    ; set blinking ON
  125.     Call    BLINK                   ; call BLINK/INTENSITY control
  126.     mov     ah,2                    ; function 02h - set cursor
  127.     mov     dx,0e00h                ; position cursor to 14,0
  128.     mov     bh,0                    ; video page 0
  129.     int     10h                     ; BIOS video service
  130.     mov     ax,4C00h                ; Return Code = 0
  131.     int     21h
  132.     END
  133.